<template>
    <div class="main-container" id="requisizione">
        <div style="background-color: #fff; height:100%">
            <a-tabs   :lazy-load="true" type="card" @change="tabsChange" justify :default-active-key="active">
                <a-tab-pane title="创建领料单" key="1" v-if="permissionStore.hasPermisson('lld.xqdcjlld')">
                    <div style="height: 100%;">
                        <materiallistArray></materiallistArray>
                    </div>
                </a-tab-pane>
                <a-tab-pane title="领料单审核" key="2" v-if="permissionStore.hasPermisson('lld.lldsh')">
                    <div style="height: 100%;">
                        <PickingListApproval></PickingListApproval>
                    </div>
                </a-tab-pane>
            </a-tabs>
        </div>
    </div>
</template>
<script  lang="ts">
import { defineComponent, reactive, ref } from 'vue'
import emitter from '@/hooks/useEventBus'
import usePermission from '@/store/modules/permission'
import { useRoute } from 'vue-router'

export default defineComponent({
    name: 'requisizione',
    setup() {
        const route = useRoute()

        const active = ref('1')
        if (route.query.key) {
            active.value = route.query.key
        }
        const pageData = reactive({
            tableIndex: "1"
        })

        const tabsChange = (e: string | number) => {
            emitter.emit('window-change')
            if (e === 1) {
                emitter.emit('materiallistArray')
            } else if (e === 2) {
                emitter.emit('PickingListApproval')
            }
        }
        const permissionStore = usePermission()
        return {
            pageData,
            tabsChange,
            permissionStore,
            active
        }
    }
})
</script>


<style  scoped>
.main-container {
    height: 100%;
}

:deep(.ag-cell-value) {
    user-select: initial;
    -moz-user-select: text;
    -ms-user-select: text;
    -webkit-user-select: text;
}
</style>
